package com.example.test.advice.第六章_枚举和注解.建议91_枚举和注解结合使用威力更大;

import com.google.errorprone.annotations.IncompatibleModifiers;

public class Client {

    public static void main(String[] args) {
        //初始化商业逻辑
        Foo b = new Foo();
        //获取注解
        Access access = b.getClass().getAnnotation(Access.class);
        //没有Access注解或者鉴权失败
        if(access == null || !access.level().identifiy()){
            //没有Access注解或者鉴权失败
            System.out.println(access.level().REFUESE_WORD);
        }
    }
}

@Access(level = CommonIdentifier.Author)
class Foo{

}